package com.sharesrc.umangadownloader.server.services;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.sharesrc.umangadownloader.client.browse.IFBrowseService;
import com.sharesrc.umangadownloader.server.services.browse.BrowserFactory;
import com.sharesrc.umangadownloader.server.services.browse.IFBrowser;
import com.sharesrc.umangadownloader.shared.model.MangaDesc;
import com.sharesrc.umangadownloader.shared.model.MangaSiteInfo;
import com.sharesrc.umangadownloader.shared.model.SitePageInfo;

public class BrowseServiceImpl extends RemoteServiceServlet implements IFBrowseService {

	/**
	 * 
	 */
	private static final long serialVersionUID = 201307091041L;

	@Override
	public MangaSiteInfo getMangaSiteInfo(String siteName, String childSiteId) throws IllegalArgumentException {
		IFBrowser browser = BrowserFactory.getBrowser(siteName);
		return browser.getMangaSiteInfo(childSiteId);
	}

	@Override
	public SitePageInfo getSitePageInfo(String siteName, String childSiteId, String pageIndex) throws IllegalArgumentException {
		IFBrowser browser = BrowserFactory.getBrowser(siteName);
		return browser.getSitePageInfo(childSiteId, pageIndex);
	}

	@Override
	public MangaDesc getMangaDesciption(String siteName, String mangaLink) throws IllegalArgumentException {
		IFBrowser browser = BrowserFactory.getBrowser(siteName);
		return browser.getMangaDesciption(mangaLink);
	}
}
